Railways Exam  >  Railways Questions  >   Chose the best appropriate answer for the be... Start Learning for Free
Chose the best appropriate answer for the below given code:
#include
int main()
{
printf("TESTBOOK");
main();
return 0;
}
  • a)
    It will give an error
  • b)
    TESTBOOK will be printed infinitely
  • c)
    TESTBOOK will be printed until system gets shut down
  • d)
    TESTBOOK would be printed until stack overflow happens
Correct answer is option 'D'. Can you explain this answer?
Verified Answer
Chose the best appropriate answer for the below given code:#include i...
  • There is no restriction of main() calling main(), that is, recursion can happen for main() function also
  • There is no explicit termination condition mentioned for main() recursion; So main() would be calling main() after printing TESTBOOK, this will go on until Stack of the program would be filled completely
Important Points:
Stack stores the calling function sequence, that is, which function has called which function so that the control can be returned when the called function returns. That’s why here in the program, main() would continue to call main() until the complete stack is over, that is, stack-overflow occurs.
View all questions of this test
Explore Courses for Railways exam
Chose the best appropriate answer for the below given code:#include int main(){printf("TESTBOOK");main();return 0;}a)It will give an errorb)TESTBOOK will be printed infinitelyc)TESTBOOK will be printed until system gets shut downd)TESTBOOK would be printed until stack overflow happensCorrect answer is option 'D'. Can you explain this answer?
Question Description
Chose the best appropriate answer for the below given code:#include int main(){printf("TESTBOOK");main();return 0;}a)It will give an errorb)TESTBOOK will be printed infinitelyc)TESTBOOK will be printed until system gets shut downd)TESTBOOK would be printed until stack overflow happensCorrect answer is option 'D'. Can you explain this answer? for Railways 2024 is part of Railways preparation. The Question and answers have been prepared according to the Railways exam syllabus. Information about Chose the best appropriate answer for the below given code:#include int main(){printf("TESTBOOK");main();return 0;}a)It will give an errorb)TESTBOOK will be printed infinitelyc)TESTBOOK will be printed until system gets shut downd)TESTBOOK would be printed until stack overflow happensCorrect answer is option 'D'. Can you explain this answer? covers all topics & solutions for Railways 2024 Exam. Find important definitions, questions, meanings, examples, exercises and tests below for Chose the best appropriate answer for the below given code:#include int main(){printf("TESTBOOK");main();return 0;}a)It will give an errorb)TESTBOOK will be printed infinitelyc)TESTBOOK will be printed until system gets shut downd)TESTBOOK would be printed until stack overflow happensCorrect answer is option 'D'. Can you explain this answer?.
Solutions for Chose the best appropriate answer for the below given code:#include int main(){printf("TESTBOOK");main();return 0;}a)It will give an errorb)TESTBOOK will be printed infinitelyc)TESTBOOK will be printed until system gets shut downd)TESTBOOK would be printed until stack overflow happensCorrect answer is option 'D'. Can you explain this answer? in English & in Hindi are available as part of our courses for Railways. Download more important topics, notes, lectures and mock test series for Railways Exam by signing up for free.
Here you can find the meaning of Chose the best appropriate answer for the below given code:#include int main(){printf("TESTBOOK");main();return 0;}a)It will give an errorb)TESTBOOK will be printed infinitelyc)TESTBOOK will be printed until system gets shut downd)TESTBOOK would be printed until stack overflow happensCorrect answer is option 'D'. Can you explain this answer? defined & explained in the simplest way possible. Besides giving the explanation of Chose the best appropriate answer for the below given code:#include int main(){printf("TESTBOOK");main();return 0;}a)It will give an errorb)TESTBOOK will be printed infinitelyc)TESTBOOK will be printed until system gets shut downd)TESTBOOK would be printed until stack overflow happensCorrect answer is option 'D'. Can you explain this answer?, a detailed solution for Chose the best appropriate answer for the below given code:#include int main(){printf("TESTBOOK");main();return 0;}a)It will give an errorb)TESTBOOK will be printed infinitelyc)TESTBOOK will be printed until system gets shut downd)TESTBOOK would be printed until stack overflow happensCorrect answer is option 'D'. Can you explain this answer? has been provided alongside types of Chose the best appropriate answer for the below given code:#include int main(){printf("TESTBOOK");main();return 0;}a)It will give an errorb)TESTBOOK will be printed infinitelyc)TESTBOOK will be printed until system gets shut downd)TESTBOOK would be printed until stack overflow happensCorrect answer is option 'D'. Can you explain this answer? theory, EduRev gives you an ample number of questions to practice Chose the best appropriate answer for the below given code:#include int main(){printf("TESTBOOK");main();return 0;}a)It will give an errorb)TESTBOOK will be printed infinitelyc)TESTBOOK will be printed until system gets shut downd)TESTBOOK would be printed until stack overflow happensCorrect answer is option 'D'. Can you explain this answer? tests, examples and also practice Railways tests.
Explore Courses for Railways exam

Top Courses for Railways

Explore Courses
Signup for Free!
Signup to see your scores go up within 7 days! Learn & Practice with 1000+ FREE Notes, Videos & Tests.
10M+ students study on EduRev